$(document).ready(function () {
  // 右侧导航渲染
  let showData_first = function (id_a, id_b, id_c) {
    $.ajax({
      type: 'get',
      url: '/article',
      data: {
        id_a: id_a,
        id_b: id_b,
        id_c: id_c
      },
      success: function (data) {
        let firstHtml = template('first_template', { list: data[1] });
        $('.com-rightSidebar_ul_one').html(firstHtml);
        let secondHtml = template('second_template', { list: data[0] });
        $("#cntrLastArticle").html(secondHtml);
        let thirdHtml = template('third_template', { list: data[2] });
        $('.com-rightSidebar_div_three').html(thirdHtml);
      }
    })
  }
  showData_first(20, 21, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
  // 左侧文章底部渲染
  let showData_second = function (id_a, id_b) {
    $.ajax({
      type: 'get',
      url: '/article_footer',
      data: {
        id_a: id_a,
        id_b: id_b
      },
      success: function (data) {
        console.log(data);
        let firstHtml = template('footer_a_template', { list: data[0] });
        $('.art_box_ul').html(firstHtml);
        let secondHtml = template('footer_b_template', { list: data[1] });
        $('.art_box_bottom div ul').html(secondHtml)
      }
    })
  }
  let randomNum = parseInt(Math.random() * (14 - 5 + 1) + 5, 10);
  showData_second([21, 22, 23], [randomNum, randomNum, randomNum, randomNum]);
});